Optimal. Leaf size=56 \[ -\frac{a^2 \cot ^2(e+f x)}{2 f}-\frac{a (a-2 b) \log (\tan (e+f x))}{f}-\frac{(a-b)^2 \log (\cos (e+f x))}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0816643, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 88} \[ -\frac{a^2 \cot ^2(e+f x)}{2 f}-\frac{a (a-2 b) \log (\tan (e+f x))}{f}-\frac{(a-b)^2 \log (\cos (e+f x))}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3670
Rule 446
Rule 88
Rubi steps
\begin{align*} \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^2}{x^3 \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{(a+b x)^2}{x^2 (1+x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{a^2}{x^2}-\frac{a (a-2 b)}{x}+\frac{(a-b)^2}{1+x}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac{a^2 \cot ^2(e+f x)}{2 f}-\frac{(a-b)^2 \log (\cos (e+f x))}{f}-\frac{a (a-2 b) \log (\tan (e+f x))}{f}\\ \end{align*}
Mathematica [A] time = 0.243094, size = 51, normalized size = 0.91 \[ -\frac{a^2 \cot ^2(e+f x)+2 a (a-2 b) \log (\tan (e+f x))+2 (a-b)^2 \log (\cos (e+f x))}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.056, size = 62, normalized size = 1.1 \begin{align*} -{\frac{{b}^{2}\ln \left ( \cos \left ( fx+e \right ) \right ) }{f}}+2\,{\frac{ab\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}-{\frac{{a}^{2} \left ( \cot \left ( fx+e \right ) \right ) ^{2}}{2\,f}}-{\frac{{a}^{2}\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.11063, size = 69, normalized size = 1.23 \begin{align*} -\frac{b^{2} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) +{\left (a^{2} - 2 \, a b\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac{a^{2}}{\sin \left (f x + e\right )^{2}}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.12393, size = 234, normalized size = 4.18 \begin{align*} -\frac{b^{2} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} + a^{2} \tan \left (f x + e\right )^{2} +{\left (a^{2} - 2 \, a b\right )} \log \left (\frac{\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} + a^{2}}{2 \, f \tan \left (f x + e\right )^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 9.12316, size = 131, normalized size = 2.34 \begin{align*} \begin{cases} \tilde{\infty } a^{2} x & \text{for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \cot ^{3}{\left (e \right )} & \text{for}\: f = 0 \\\frac{a^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac{a^{2} \log{\left (\tan{\left (e + f x \right )} \right )}}{f} - \frac{a^{2}}{2 f \tan ^{2}{\left (e + f x \right )}} - \frac{a b \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac{2 a b \log{\left (\tan{\left (e + f x \right )} \right )}}{f} + \frac{b^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.64026, size = 223, normalized size = 3.98 \begin{align*} \frac{a^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 4 \, b^{2} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right ) + 4 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right )}{8 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]